﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TR.AppService.Dto;
using TR.AppService.Dto.BSDto;
using TR.Domain.Entity;
using TR.Domain.Entity.BsItemType;
using TR.Domain.Repository.Bs_WareAreaRepository;
using TR.Domain.Repository.Bs_warehouseRepostiory;
using TR.Domain.Repository.BsItemRepository;

namespace TR.AppService.AppService.Bs_WareArea
{
    public class Bs_WareAreaService : IBs_WareAreaService
    {
        private readonly Ibs_WareAreaRepository ibs_WarehouseRepostiory;
        private readonly IMapper mapper;
        public Bs_WareAreaService(Ibs_WareAreaRepository ibs_WarehouseRepostiory, IMapper mapper)
        {
            this.ibs_WarehouseRepostiory = ibs_WarehouseRepostiory;
            this.mapper = mapper;
        }

        public Task<bool> wareareaAdd(bs_Ware_Area addareaDto)
        {
            bs_Ware_Area bs = mapper.Map<bs_Ware_Area>(addareaDto);
            return ibs_WarehouseRepostiory.WareAreaAdd(addareaDto);
        }

        public Task<bs_Ware_Area> wareareaSelectid(int id)
        {
            return ibs_WarehouseRepostiory.WareAreaSelectid(id);
        }

        public Task<bool> wareareaUDelect(int id)
        {
            return ibs_WarehouseRepostiory.WareAreaUDelect(id);
        }

        public Task<bool> wareareaUpdate(bs_Ware_Area uAd)
        {
            return ibs_WarehouseRepostiory.WareAreaUpdate(uAd);
        }

        public Task<FenYe<bs_Ware_Area>> warearea_FenYe(int pageSize, int currentPage, string str)
        {
            return ibs_WarehouseRepostiory.WareArea_FenYeAsync(pageSize, currentPage, str);
        }
    }
}
